<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2016/9/18
 * Time: 10:17
 */
//Function handling 函数
//call_​user_​func_​array
//	call_​user_​func
//create_​function
//forward_​static_​call_​array
//	forward_​static_​call
//func_​get_​arg
//func_​get_​args
//func_​num_​args
//function_​exists
//get_​defined_​functions
//register_​shutdown_​function
//register_​tick_​function
//unregister_​tick_​function
function foo() {
	$numargs = func_num_args();
	echo "Number of arguments: $numargs<br />\n";
	if ( $numargs >= 2 ) {
		echo "Second argument is: " . func_get_arg( 1 ) . "<br />\n";
	}
	$arg_list = func_get_args();
	for ( $i = 0; $i < $numargs; $i ++ ) {
		echo "Argument $i is: " . $arg_list[ $i ] . "<br />\n";
	}
}

foo( 1, 2, 3 );